//
//  MXVisibleFooderCommV.m
//  HNBaseProject
//
//  Created by xujie on 2024/6/3.
//

#import "MXVisibleFooderCommV.h"

@implementation MXVisibleFooderCommV

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self createUI];
    }
    return self;
}

- (void)createUI {
    self.userInteractionEnabled = YES;
    self.icon = [[UIImageView alloc] init];
    [self addSubview:self.icon];
    [self.icon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self);
        make.height.width.mas_equalTo(37);
        make.top.offset(0);
    }];
    
    self.bottomLab = [[UILabel alloc] init];
    self.bottomLab.textColor = [UIColor colorWithHexString:@"#000000"];
    self.bottomLab.font = PFRFontMedium(10);
    [self addSubview:self.bottomLab];
    [self.bottomLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.offset(0);
        make.centerX.mas_equalTo(self);
    }];
}

- (void)reloadViewWithIconName:(NSString *)iconName bottomTitle:(NSString *)title {
    
    self.icon.image = [UIImage imageNamed:iconName];
    self.bottomLab.text = title;
}

@end
